<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript" src="JS/jquery.js"></script>
<script type="text/javascript" src="JS/jquery.form.js"></script>
<script language="javascript">

var callback='callback';

$(function(){
	
	var url=document.location.href;
	var query=url.split('?')[1];
	var paramObj={};
	
	if(query!=undefined)
	{
		var params=query.split('&');
		for(var i=0;i<params.length;i++)
		{
			var sp=params[i].split('=');
			var key=sp[0];
			var val=sp[1];
			paramObj[key]=val;
		}
		
		if(paramObj.callback!=undefined)
		{
			callback=paramObj.callback;
		}
	}
	
	$("#form1").ajaxForm({
		success:function(json)
		{
			//alert(json.data[0].savename);
			window.parent[callback](json.data[0].savename);
			$("#form1").resetForm();
		},
		dataType : 'json'
	});
});
</script>
<style type="text/css">
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	font-size:10px;
}

</style>



</head>

<body>
<form action="/admin.php/Attachment/ajaxupload" method="post" enctype="multipart/form-data" name="form1" id="form1">
  <label for="fileField"></label>
  <input type="file" name="fileField" id="fileField" />
  <input type="submit" name="button" id="button" value="上传" />
</form>
</body>
</html>
